import request from '@/router/axios';
import { data } from 'jquery';

export const getCustomerList = (current, size, params) => {
    return request({
        url: '/api/mes-admin/customer/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}


export const addCustomer = (row) => {
    return request({
        url: '/api/mes-admin/customer/submit',
        method: 'post',
        data: row
    })
}


export const removeCustomer = (ids) => {
    return request({
        url: '/api/mes-admin/customer/remove',
        method: 'post',
        data: ids
    })
}

export const getCustomerDetail = (current, size, id) => {
    return request({
        url: '/api/mes-admin/customer/detail',
        method: 'get',
        params: {
            current,
            size,
            id
        }
    })
}




export const getCustomerPartList = (current, size, params) => {
    return request({
        url: '/api/mes-admin/customer/part/mapping/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}


export const addPartCustomer = (row) => {
    return request({
        url: '/api/mes-admin/customer/part/mapping/submit ',
        method: 'post',
        data: row
    })
}


export const removePartCustomer = (ids) => {
    return request({
        url: '/api/mes-admin/customer/part/mapping/remove',
        method: 'get',
        params: {
            ids
        }
    })
}

export const getPartCustomerDetail = (id) => {
    return request({
        url: '/api/mes-admin/customer/part/mapping/detail',
        method: 'get',
        params: {
            id
        }
    })
}


export const getCustomerLotList = (current, size, params) => {
    return request({
        url: '/api/mes-admin/customer/date/code/mapping/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}


export const addLotCustomer = (row) => {
    return request({
        url: '/api/mes-admin/customer/date/code/mapping/submit',
        method: 'post',
        data: row
    })
}


export const removeLotCustomer = (ids) => {
    return request({
        url: '/api/mes-admin/customer/date/code/mapping/remove',
        method: 'get',
        params: {
            ids
        }
    })
}

export const getLotCustomerDetail = (id) => {
    return request({
        url: '/api/mes-admin/customer/date/code/mapping/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const getCustomerShippingList = (current, size, params) => {
    return request({
        url: '/api/mes-admin/customer/shipping/address/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}




export const remove = (ids) => {
    return request({
        url: '/api/mes-admin/partner/remove',
        method: 'post',
        params: {
            ids,
        }
    })
}

export const add = (row) => {
    return request({
        url: '/api/mes-admin/partner/submit',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/api/mes-admin/partner/submit',
        method: 'post',
        data: row
    })
}


export const getPartList = (current, size, params) => {
    return request({
        url: '/api/mes-admin/partCustMapping/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const getPartDetail = (id) => {
    return request({
        url: '/api/mes-admin/partCustMapping/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const removePart = (ids) => {
    return request({
        url: '/api/mes-admin/partCustMapping/remove',
        method: 'get',
        params: {
            ids,
        }
    })
}

export const addPart = (row) => {
    return request({
        url: '/api/mes-admin/partCustMapping/submit',
        method: 'post',
        data: row
    })
}

export const updatePart = (row) => {
    return request({
        url: '/api/mes-admin/partCustMapping/submit',
        method: 'post',
        data: row
    })
}

export const importPart = (row) => {
    return request({
        url: '/api/mes-admin/partCustMapping/import',
        method: 'post',
        data: row
    })
}

export const getLotNoList = (current, size, params) => {
    return request({
        url: '/api/mes-admin/partnerDatecodeMapping/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const getLotNoDetail = (id) => {
    return request({
        url: '/api/mes-admin/partnerDatecodeMapping/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const removeLotNo = (ids) => {
    return request({
        url: '/api/mes-admin/partnerDatecodeMapping/remove',
        method: 'get',
        params: {
            ids,
        }
    })
}

export const addLotNo = (row) => {
    return request({
        url: '/api/mes-admin/partnerDatecodeMapping/submit',
        method: 'post',
        data: row
    })
}

export const updateLotNo = (row) => {
    return request({
        url: '/api/mes-admin/partnerDatecodeMapping/submit',
        method: 'post',
        data: row
    })
}

export const importLotNo = (row) => {
    return request({
        url: '/api/mes-admin/partnerDatecodeMapping/import',
        method: 'post',
        data: row
    })
}

